// 样式
import './scss/index.scss'

// 插件
import element from './plugin/element' // 饿了么
import nprogress from './plugin/nprogress' // 路由切换进度条

// 组件
import Form from './components/Form.vue'
import FormGroup from './components/FormGroup.vue'

import DialogEdit from './components/DialogEdit.vue'

// import FormItemGroup from './components/FormItemGroup.vue'
import FormItem from './components/FormItem.vue'
import InputFile from './components/input-file/InputFile.vue'
import Upload from './components/Upload.vue' // 上传组件
import Info from './components/Info.vue'

import Desc from './components/Desc.vue'
import DescItem from './components/DescItem.vue'

const components = [Form, FormGroup, FormItem, Upload, InputFile, Info, Desc, DescItem, DialogEdit]

export default {
  install(app, context) {
    // 注册组件
    components.forEach((component) => {
      app.component(component.name, component)
    })

    // 引入饿了么
    app.use(element)

    // 路由切换进度条
    app.use(nprogress, context)
  },
}
